<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/client/backgroundManagement/commons/global.jsp" %>
<script type="text/javascript">

    $(function() {
        
    	//负责人 
    	 $('#managerUser').combobox({
       // $('#managerUser').combotree({
            url : '${path }/userController/tree',
            valueField:'id' ,
            textField:'text' ,//当text会空时,自带的模糊查询会有问题
            lines : true,
            editable:true,
           // panelHeight : 'auto'
            
        });
    	
       //所属部门
        $('#pid').combotree({
            url : '${path }/organizationController/tree?type=parentOrg',
            parentField : 'pid',
            lines : true,
          //  required: true, 当不选择时如何??
           // panelHeight : 'auto'
        });
        
        $('#organizationAddForm').form({
            url : '${path }/organizationController/add',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    parent.$.modalDialog.openner_treeGrid.treegrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_treeGrid这个对象，是因为organization.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                }else{
                 	 console.log(result)
                	 alert("操作失败,请稍后重试")
                }
            }
        });
        
    });
</script>
<div style="padding: 3px;">
    <form id="organizationAddForm" method="post">
        <table class="grid">
            <tr>

                <td>部门名称</td>
                <td><input name="name" type="text" placeholder="请输入部门名称" class="easyui-validatebox" data-options="required:true" ></td>
                
            </tr>
<!-- 
                <td>编号</td>
                <td><input name="code" type="text" placeholder="请输入部门编号" class="easyui-validatebox" data-options="required:true" ></td>
            <tr>
                <td>排序</td>
                <td><input name="seq"  class="easyui-numberspinner" style="width: 140px; height: 29px;" required="required" data-options="editable:false" value="0"></td>
                <td>菜单图标</td>
                <td><input  name="icon" value="icon-folder"/></td>
            </tr>

 -->
           <tr>
                    <td>类型</td>
                    <td>
                        <select name="type" class="easyui-combobox" data-options="width:150,height:29,editable:false,panelHeight:'auto'">
                            <option value="1">集团/公司</option>
                            <option value="2">事业部门</option>
                            <option value="3" selected="selected">拓展小组</option>
                        </select>
                    </td>
                    
            <tr>
                <td>负责人</td>
                <td colspan="3"><select id="managerUser" name="managerUser" style="width:150px;height: 29px;"></select>
            </tr>
            <tr>
                <td>上级部门</td>
                <td colspan="3"><select id="pid" name="pid" style="width:150px;height: 29px;"></select>
                <a class="easyui-linkbutton" href="javascript:void(0)" onclick="$('#pid').combotree('clear');" >清空</a></td>
                
            </tr>
			 
			
		    <tr>
             <td>核查项目指标</td>
                <td><input name="hechaTarget" type="text" placeholder="请输入指标" class="easyui-numberbox"    ></td>
            </tr>
            
             <tr>
             <td>洽谈项目指标</td>
                <td><input name="qiatanTarget" type="text" placeholder="请输入指标" class="easyui-numberbox"    ></td>
            </tr>
			
			<!-- -->
        </table>
    </form>
</div>